<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="iweb mall" />
<meta name="description" content="iweb mall" />
<title>会员注册</title>
<link href="skin/default/css/index.css" rel="stylesheet" type="text/css" />
<link href="skin/default/css/import.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="skin/default/js/changeStyle.js"></script>
<script type="text/javascript" src="skin/default/js/area.js"></script>
</head>
<body>
<div id="wrapper">

<div id="header" class="clearfix">
    <div class="site_nav clearfix">
      <p class="login_info"><span>您好，欢迎来到iweb Mall!</span><a href="login.php">登录</a>&nbsp;|&nbsp;<a href="modules.php?app=reg">免费注册</a></p>
      <p class="quick_menu">
        <a href="index.php">商城首页</a><a href="modules.php">用户中心</a>
        <a class="shop_cart" href="modules.php?app=user_cart">购物车</a>

        <a href="modules.php?app=user_favorite">收藏夹</a>
      </p>
    </div>
    <div class="topMain clearfix">
      <h1 id="logo">
  		  			<a href="index.php"><img src="skin/default/images/img_logo.gif" title="" alt="iweb Mall" /></a>
  		      </h1>
      <form action="search.php" method="POST" id="search_form" >

      <div class="search_panel clearfix">
    	<p class="search_sel" onclick="setShow('sel_content');setOnShowPara('sel_content');">
			    			<input class="sel_value" id="sel_value" value="搜商品" name="search_type" type="text" />
			    	</p>
    	        <p class="search_txt"><input name="k" type="text" onblur="inputTxt(this,'set');" onfocus="inputTxt(this,'clean');" value="请输入你要搜索的关键字" /></p>
              
        <p class="search_btn"><input type="submit" value="" /></p>
        <div id="sel_content" class="sel_list" style="display:none">
        	<ul><li onclick="document.getElementById('sel_value').value = this.innerHTML" onmouseover="this.className = 'li_hover'" onmouseout="this.className = ''">搜商品</li><li onclick="document.getElementById('sel_value').value = this.innerHTML" onmouseover="this.className = 'li_hover'" onmouseout="this.className = ''">搜商家</li></ul>

        </div>
      </div>
      </form>
    </div>
</div>

<input type="text" name="sel_content_c" id="sel_content_c" size="0" onblur="javascript:timerSetHidden('sel_content',200);" style="top:-100px;position:absolute;width:1px;height:1px;border:0px;background-color:transparent;" value="1">

<div id="contents" class="clearfix" >
<h3 class="ttlm_login">用户注册</h3>

     <form action="do.php?act=register" name="reg_form" method="post">

     <div id="login_leftColumn" class="w_395">
     	<p class="mg12b">Email帐号：</p>
          <p class="mg12b">
          	<input type="text" class="txt_230 ipt_nomal" name="user_email" autocomplete="off"  value=""/><span id="user_email_message" class="hint"></span>
          </p>
          <p class="tip mg12b">请输入您的常用邮箱，方便日后找回密码。</p>
          <p class="mg12b">会员用户名：</p>

          <p class="mg12b">
          	<input type="text" class="txt_230 ipt_nomal" name="user_name" id="user_name" onblur="checkname();" autocomplete="off" value="" /><span id="user_name_message" class="hint"></span>
          </p>

          <p class="tip mg12b">由4-16位数字、英文字母或中文组成(一个中文2位)</p>
          <p class="mg12b">设置密码：</p>
          <p class="mg12b">
          	<input class="txt_230 ipt_nomal" type="password" name="user_password" id="user_password" autocomplete="off" /><span id="user_password_message" class="hint"></span>

          </p>
          <p class="tip mg12b">数字或英文，6-16位</p>
          <p class="mg12b">确认密码：</p>
          <p class="mg12b">
          	<input class="txt_230 ipt_nomal" type="password" name="user_repassword" id="user_repassword" /><span id="user_repassword_message" class="hint"></span>
          </p>
          <p class="tip mg12b">重复上面的密码。</p>

		            <p class="mg12b">验证码：</p>
          <p class="vali mg12b">
          	<input type="text" class="txt_230" name="veriCode" id="veriCode" style="width:100px" maxlength="4" /> 
          	<img border="0" src="servtools/veriCodes.php" align="absmiddle" id="verCodePic"><a href="javascript:;" onclick="return getVerCode();">看不清,换一张</a>
          	<SPAN id="veriCode_message"></SPAN>
          </p>
		   <p class="tip mg12b">请输入上图中的文字</p>
		           
		  <div class="login_submit">

				<input class="btn_02" type="button" value="马上注册" name="regcheckbtn" onclick="checkcode();"/>
		  </div>
      </div>
      </form>

     <div id="login_rightColumn" class="w_443"></div>
</div>

<script language="JavaScript" src="servtools/ajax_client/ajax.js"></script>
<script language="JavaScript">
function rlength(v){
	return v.replace(/[^\x00-\xff]/g, 'xx').length; 
}

function getVerCode() {
	document.getElementById("verCodePic").src="servtools/veriCodes.php?vc="+Math.random();
	return false;
}

// 检测会员用户名
var user_name = document.getElementsByName('user_name')[0];
var user_name_message = document.getElementById('user_name_message');
var user_name_status = false;
var user_name_reg = /^(\w|[\u0391-\uFFE5])*$/;
user_name.onmouseover = function()
{
	user_name.className = 'txt_230 ipt_focus';
};
user_name.onmouseout = function()
{
	user_name.className = 'txt_230 ipt_nomal';
}; 

 function checkname(){
	 var user_name = document.getElementsByName('user_name')[0];
	if(user_name.value=='') {
		user_name_message.style.color = 'red';
		user_name_message.innerHTML = '* 请填写会员用户名！';
		user_name_status = false;
	} else if(!user_name.value.match(user_name_reg)) {
		user_name_message.style.color = 'red';
		user_name.className = 'txt_230 ipt_error';
		user_name.onmouseout= 'txt_230 ipt_error'; 
		user_name_message.innerHTML = '* 会员用户名格式不正确！';
		user_name_status = false;
	}else if(rlength(user_name.value)<4||rlength(user_name.value)>16){
		user_name_message.style.color = 'red';
		user_name.className = 'txt_230 ipt_error';
		user_name.onmouseout= 'txt_230 ipt_error'; 
		user_name_message.innerHTML = '* 会员用户名格式不正确！';
		user_name_status = false;
	}else {
		user_name_message.style.color = 'red';
		user_name.className = 'txt_230 ipt_error';
		user_name.onmouseout= 'txt_230 ipt_error'; 
		user_name_message.innerHTML = '* 正在检测您的用户名是否可用！';
		ajax("do.php?act=user_check_username","POST","v="+user_name.value,function(data){
			if(data==1) {
				user_name_message.style.color = 'green';
				user_name_message.innerHTML = '恭喜，您的用户名可用！';
				user_name_status = true;
			} else {
				user_name_message.style.color = 'red';
				user_name_message.innerHTML = '* 此用户名已被使用！';
				user_name_status = false;
			}
		});
	}
};

// 检测邮箱
var user_email = document.getElementsByName('user_email')[0];
var user_email_message = document.getElementById('user_email_message');
var user_email_status = false;
var user_email_reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
user_email.onmouseover = function(){user_email.className = 'txt_230 ipt_focus'};
user_email.onmouseout = function(){user_email.className = 'txt_230 ipt_nomal'}; 
user_email.onblur = function(){
	if(user_email.value=='') {
		user_email_message.style.color = 'red';
		user_email_message.innerHTML = '* 请填写Email帐号！';
		user_email_status = false;
	} else if(!user_email.value.match(user_email_reg)) {
		user_email_message.style.color = 'red';
		 user_email.className = 'txt_230 ipt_error';
		 user_email.onmouseout = 'txt_230 ipt_error'; 		
		 user_email_message.innerHTML = '* Email帐号格式不正确！';
		user_email_status = false;
	} else {
		user_email_message.style.color = 'red';
		 user_email.className = 'txt_230 ipt_error';
		 user_email.onmouseout = 'txt_230 ipt_error'; 		
		user_email_message.innerHTML = '* 正在检测您的Email帐号是否可用！';
		ajax("do.php?act=user_check_useremail","POST","v="+user_email.value,function(data){
			if(data==1) {
				user_email_message.style.color = 'green';
				user_email_message.innerHTML = '恭喜，您的Email帐号可用！';
				user_email_status = true;
			} else {
				user_email_message.style.color = 'red';
				user_email_message.innerHTML = '* 此Email帐号已被使用！';
				user_email_status = false;
			}
		});
	}
};

// 检测密码
var user_password = document.getElementsByName('user_password')[0];
var user_password_message = document.getElementById('user_password_message');
var user_password_status = false;
user_password.onmouseover = function(){user_password.className = 'txt_230 ipt_focus'};
user_password.onmouseout = function(){user_password.className = 'txt_230 ipt_nomal'}; 
user_password.onblur = function(){
	if(user_password.value=='') {
		user_password_message.style.color = 'red';
		user_password_message.innerHTML = '* 请填写密码！';
		user_password_status = false;
	} else if(user_password.value.length<6 || user_password.value.length>16) {
		user_password_message.style.color = 'red';
		 user_password.className = 'txt_230 ipt_error';
		user_password.onmouseout='txt_230 ipt_error';
		user_password_message.innerHTML = '* 填写的密码格式不正确！';
		user_password_status = false;
	} else {
		user_password_message.style.color = 'green';
		user_password_message.innerHTML = '密码格式正确！';
		user_password_status = true;
	}
};

// 检测确认密码
var user_repassword = document.getElementsByName('user_repassword')[0];
var user_repassword_message = document.getElementById('user_repassword_message');
var user_repassword_status = false;
user_repassword.onmouseover = function(){user_repassword.className = 'txt_230 ipt_focus'};
user_repassword.onmouseout = function(){user_repassword.className = 'txt_230 ipt_nomal'}; 
user_repassword.onblur = function(){
	if(user_repassword.value=='') {
		user_repassword_message.style.color = 'red';
		user_repassword_message.innerHTML = '* 请填写确认密码！';
		user_repassword_status = false;
	} else if(user_repassword.value!=user_password.value) {
		user_repassword_message.style.color = 'red';
		 user_repassword.className = 'txt_230 ipt_error';
		 user_repassword.onmouseout='txt_230 ipt_error'; 		
		 user_repassword_message.innerHTML = '* 两次填写的密码不一致！';
		user_repassword_status = false;
	} else {
		user_repassword_message.style.color = 'green';
		user_repassword_message.innerHTML = '确认密码格式正确！';
		user_repassword_status = true;
	}
};



function checkcode(){
		var cvalue=document.getElementById("veriCode").value;
	var veriCode = document.getElementsByName('veriCode')[0];
	var veriCode_message = document.getElementById('veriCode_message');
	if(cvalue==''){
		veriCode_message.style.color = 'red';
		veriCode.className = 'txt_230 ipt_focus'; 
		veriCode_message.innerHTML = '请填写验证码！';
		return false;
	}
	ajax('do.php?act=checkcode','POST','checkcode='+cvalue,function(data){
		if(data==1){
			veriCode_message.innerHTML = '';
			if(checkForm()){
            	document.reg_form.submit();
			}
		}else{
			veriCode_message.style.color = 'red';
			veriCode.className = 'txt_230 ipt_focus'; 
			veriCode_message.innerHTML = '验证码错误';
            return false;
		}
		
	});
	}

function checkForm() {
		var veriCode = document.getElementsByName('veriCode')[0];
	var veriCode_message = document.getElementById('veriCode_message');
	if(veriCode.value=='') {
		veriCode_message.style.color = 'red';
		veriCode.className = 'txt_230 ipt_focus'; 
		veriCode_message.innerHTML = '请填写验证码！';
		return false;
	}
		if(user_name_status && user_email_status && user_password_status && user_repassword_status) {
		return true;
	} else {
		user_name.onblur();
		user_email.onblur();
		user_password.onblur();
		user_repassword.onblur();
		if(user_name_status && user_email_status && user_password_status && user_repassword_status) {
			return true;
		}
		return false;
	}
}
var $ = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
}


</script>

<!-- main end -->
<!--main right end-->
<script language="javascript" type="text/javascript">
function SetCookie (name, value) {
	var today = new Date();
	var expires = new Date();
	expires.setTime(today.getTime() + 1000 * 60 * 60 * 24 * 365);
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
}
function selectlangpackage(v){
	SetCookie ('language', v);
	window.location.reload();
}
</script>

<div style="clear:both"></div>
<div id="footer" class="clearfix">
  <p class="link_bar">
    <!-- 语言选择：<select name='langpackage' onchange='selectlangpackage (this.value)'><option value='ft' >中文（繁體）</option><option value='zh' selected>中文（简体）</option></select> 
    语言选择<select name='langpackage' onchange='selectlangpackage (this.value)'><option value='ft' >中文（繁體）</option><option value='zh' selected>中文（简体）</option></select>-->
    <a href="article.php/2.html">常见问题</a>|<a href="article.php/3.html">安全交易</a>|<a href="article.php/4.html">购买流程</a>|<a href="article.php/5.html">如何付款</a>|<a href="article.php/6.html">联系我们</a>|<a href="article.php/7.html">合作提案</a>|<a href="article.php/8.html">网站地图</a></p>

  <p>Powered by <a href="http://www.jooyea.net">iWebMallv1.2</a>聚易开放式技术实验室</p>
  Copyright © 2005-2009 鲁ICP备01000010号  </div>

<!--footer end-->
</div>
</body>
</html>
